﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;

namespace Bll
{
    public class Product
    {
        public static DataTable MULTIPLE(string strCon)
        {
            return Dal.Product.MULTIPLE(strCon);
        }
        public static DataTable MULTIPLE(string strCon, int serId)
        {
            return Dal.Product.MULTIPLE(strCon, serId);
        }

        public static DataGroup MULTIPLE(string strCon, int pageSize, int pageIndex, string whereStr)
        {
            return new DataGroup(Dal.Product.MULTIPLE(strCon, pageSize, pageIndex, whereStr));
        }

        public static DataTable Single(string strCon, int pkid)
        {
            return Dal.Product.Single(strCon, pkid);
        }

        public static DataTable Single(string strCon, string urlname)
        {
            return Dal.Product.Single(strCon, urlname);
        }

        public static int Update(string strCon,
                string txbProName,
                string txbKeywords,
                string txbDescription,
                string txbProCode,
                string txbThumbURL,
                string txbImgURL,
                int txbCatID,
                int txbSerID,
                string txbProContent,
                int txbSortBy,
                int txbPKID)
        {
            return Dal.Product.Update(
                    strCon,
                    txbProName,
                    txbKeywords,
                    txbDescription,
                    txbProCode,
                    txbThumbURL,
                    txbImgURL,
                    txbCatID,
                    txbSerID,
                    txbProContent,
                    txbSortBy,
                    txbPKID
            );
        }

        public static int Update(string strCon, Model.Product pro)
        {
            return Dal.Product.Update(strCon, pro);
        }

        public static int Insert(string strCon,Model.Product pro)
        {
            return Dal.Product.Insert(strCon, pro);
        }

        public static int INSERT(string strCon, string txbProName,
               string txbKeywords,
               string txbDescription,
               string txbProCode,
               string txbThumbURL,
               string txbImgURL,
               int txbCatID,
               int txbSerID,
               string txbProContent,
               int txbSortBy
           )
        {
            return Dal.Product.INSERT(strCon, txbProName, txbKeywords, txbDescription, txbProCode, txbThumbURL, txbImgURL, txbCatID, txbSerID, txbProContent, txbSortBy);
        }

        public static int Delete(string strCon, int pkid)
        {
            return Dal.Product.Delete(strCon, pkid);
        }

    }
}
